﻿using System.ComponentModel;
using System.Xml;
using System.Xml.Serialization;

namespace Bpmn.Xml;

/// <remarks/>
[XmlInclude(typeof(StartEvent))]
[XmlInclude(typeof(IntermediateCatchEvent))]
[XmlInclude(typeof(BoundaryEvent))]
[Serializable]
[XmlType(Namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", TypeName = "tCatchEvent")]
[XmlRoot("catchEvent", Namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL", IsNullable = false)]
public abstract partial class CatchEvent : Event
{
    /// <remarks/>
    [XmlElement("dataOutput")]
    public DataOutput[] DataOutput { get; set; } = default!;

    /// <remarks/>
    [XmlElement("dataOutputAssociation")]
    public DataOutputAssociation[] DataOutputAssociation { get; set; } = default!;

    /// <remarks/>
    [XmlElement("outputSet")]
    public OutputSet OutputSet { get; set; } = default!;

    /// <remarks/>
    [XmlElement("cancelEventDefinition", typeof(CancelEventDefinition))]
    [XmlElement("compensateEventDefinition", typeof(CompensateEventDefinition))]
    [XmlElement("conditionalEventDefinition", typeof(ConditionalEventDefinition))]
    [XmlElement("errorEventDefinition", typeof(ErrorEventDefinition))]
    [XmlElement("escalationEventDefinition", typeof(EscalationEventDefinition))]
    [XmlElement("eventDefinition", typeof(EventDefinition))]
    [XmlElement("linkEventDefinition", typeof(LinkEventDefinition))]
    [XmlElement("messageEventDefinition", typeof(MessageEventDefinition))]
    [XmlElement("signalEventDefinition", typeof(SignalEventDefinition))]
    [XmlElement("terminateEventDefinition", typeof(TerminateEventDefinition))]
    [XmlElement("timerEventDefinition", typeof(TimerEventDefinition))]
    public EventDefinition[] Items { get; set; } = default!;

    /// <remarks/>
    [XmlElement("eventDefinitionRef")]
    public XmlQualifiedName[] EventDefinitionRef { get; set; } = default!;

    /// <remarks/>
    [XmlAttribute("parallelMultiple")]
    [DefaultValue(false)]
    public bool ParallelMultiple { get; set; } = false;
}
